package raytracing;

public class Interval {
	
	public float min, max;
	
	public Interval(float min, float max){
		this.min = min;
		this.max = max;
	}
	
	public boolean intersect(Interval other){
		return this.min <= other.max && other.min <= this.max;
	}
	
	public boolean overlap(Interval other){
		return this.intersect(other);
	}
	
	public Interval add(float d){
		return new Interval(min + d, max +d);
	}
	
	public Interval scale(float d){
		return new Interval(min / d, max / d);
	}

}
